<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<mesoBoard.Data.FileType>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <fieldset>
        <legend><%= Html.ThemeImage("note.png") %> File Types</legend>

        <fieldset class="child">
            <legend>Create File Type</legend>
            <% using(Html.BeginForm("CreateFileType", "FileTypes")){ %>
                <dl class="form">
                    <dt>File extension</dt>
                    <dd>
                        <%= Html.TextBox("Extension") %>
                        <%= Html.ValidationMessage("Extension") %>
                        <label>Include "."; Example: .gif</label>
                    </dd>
                    
                    <dt>Image</dt>
                    <dd>
                        <%= Html.DropDownList("Image", "(No image)") %>
                        <label>Images located in ~/Images/FileTypes</label>
                    </dd>
                    
                    <dt>&nbsp;</dt>
                    <dd><%= Html.SubmitButton("CreateFileType", "Create File Type") %></dd>
                </dl>
            <% } %>
        </fieldset>
        
        <table class="form_table">
            <tr>
                <th>Extension</th>
                <th>Image</th>
                <th></th>
                <th></th>
            </tr>
            
            <% foreach(FileType f in Model) { %>
            
            <tr>
                <td><%= f.Extension %></td>
                <td><%= string.IsNullOrWhiteSpace(f.Image) ? "No image" : Html.Image("~/Images/FileTypes/" + f.Image).ToString() %></td>
                <td><%= Html.ActionLink("Edit", "EditFileType", new { FileTypeID = f.FileTypeID })%></td>
                <td><%= Html.AdminConfirm("Delete", Url.Action("DeleteFileType", new { FileTypeID = f.FileTypeID }), Url.Action("FileTypes")) %></td>
            </tr>
            
            <% } %>
            
        </table>
        
        
        
    </fieldset>

</asp:Content>
